using System;
using System.Globalization;
using System.Windows.Media.Imaging;
using jSLApp.Client.MainService;
using jSLCore.Client.Presentation.jBinding;

namespace jSLApp.Client.Converters
{
    public class LogTypeToImageConverter : jChainConverter
    {
        public override object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            var type = (LogType)value;
            switch (type)
            {
                case LogType.System:
                    return new BitmapImage(new Uri("../Resources/Details.png", UriKind.Relative));
                case LogType.Error:
                    return new BitmapImage(new Uri("../Resources/Error.png", UriKind.Relative));
                case LogType.UserAction:
                    return new BitmapImage(new Uri("../Resources/User.png", UriKind.Relative));
            }
            return null;
        }

        public override object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            throw new NotImplementedException();
        }
    }
}